package com.mairuide.platmanager;

/**
 * 代理商地区
 * @author mh
 *
 */
public enum AgentRegion {
	
	CENTRAL_CHAIN_AREA("华中区", 0),
	EAST_CHAIN_AREA("华东区", 1),
	NORTH_CHAIN_AREA("华北区", 2),
	SOUTH_CHAIN_AREA("华南区", 3), 
	SOUTHWEST_CHAIN_AREA("西南区", 4), 
	SOUTH_CENTRAL_CHAIN_AREA("中南区", 5);
	
	// 成员变量
	private String name;
	private int indexFlag;

	// 构造方法
	private AgentRegion(String name, int indexFlag) {
		this.name = name;
		this.indexFlag = indexFlag;
	}

	// 普通方法
	public static String getIndexFlag(Integer indexFlag) {
		for (AgentRegion c : AgentRegion.values()) {
			if (c.getIndexFlag() == indexFlag) {
				return c.name;
			}
		}
		return null;
	}

	// get set 方法
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIndexFlag() {
		return indexFlag;
	}

	public void setIndexFlag(int indexFlag) {
		this.indexFlag = indexFlag;
	}
}
